/**
 * 权限与角色 接口
 *
 */

import request from "@/utils/request";
const api = {};

//-------------------菜单管理-------------------
//菜单列表
api.authMenuIndex = function(data = {}) {
    return request({
        url: "/admin/auth/menu/index",
        method: "get",
        params: data,
    });
};

//字典
api.authMenuDict = function(data = {}) {
    return request({
        url: "/admin/auth/menu/dict",
        method: "get",
        params: data,
    });
};

//审核通过
api.authMenuApproved = function(data = {}) {
    return request({
        url: " /admin/auth/user/approved",
        method: "post",
        data,
    });
};

//审核失败
api.authMenuRefuse = function(data = {}) {
    return request({
        url: " /admin/auth/user/refuse",
        method: "post",
        data,
    });
};

//状态设置
api.authuserSettingState = function(data = {}) {
    return request({
        url: "/admin/auth/user/settingState",
        method: "post",
        data,
    });
};

//状态设置 -- 角色设置
api.roleSettingState = function(data = {}) {
    return request({
        url: "/admin/auth/role/settingState",
        method: "post",
        data,
    });
};
//保存
api.authMenuAction = function(data = {}) {
    return request({
        url: "/admin/auth/menu/action",
        method: "post",
        data,
    });
};

//删除
api.authMenuDelete = function(data = {}) {
    return request({
        url: "/admin/auth/menu/delete",
        method: "post",
        data,
    });
};
//-------------------菜单管理 end-------------------

//-------------------角色管理-------------------
//列表
api.authRoleIndex = function(data = {}) {
    return request({
        url: "/admin/auth/role/index",
        method: "get",
        params: data,
    });
};

//保存
api.authRoleIAction = function(data = {}) {
    return request({
        url: "/admin/auth/role/action",
        method: "post",
        data,
    });
};

//删除
api.authRoleDelete = function(data = {}) {
    return request({
        url: "/admin/auth/role/delete",
        method: "post",
        data,
    });
};

//字典
api.authRoleDict = function(data = {}) {
    return request({
        url: "/admin/auth/role/dict",
        method: "get",
        params: data,
    });
};

//保存权限
api.authRoleSaveAuth = function(data = {}) {
    return request({
        url: "/admin/auth/role/saveAuth",
        method: "post",
        data,
    });
};

//详情
api.authRoleInfo = function(data = {}) {
    return request({
        url: "/admin/auth/role/info",
        method: "get",
        params: data,
    });
};

//-------------------角色管理 end-------------------

//-------------------用户管理-------------------
//列表
api.authUserIndex = function(data = {}) {
    return request({
        url: "/admin/auth/user/index",
        method: "get",
        params: data,
    });
};

//字典
api.authUserDict = function(data = {}) {
    return request({
        url: "/admin/auth/user/dict",
        method: "get",
        params: data,
    });
};

//保存
api.authUserAction = function(data = {}) {
    return request({
        url: "/admin/auth/user/action",
        method: "post",
        data,
    });
};
//状态设置
api.authUserSettingState = function(data = {}) {
    return request({
        url: "/admin/auth/user/settingState",
        method: "post",
        data,
    });
};
//同步用户
api.authSynchroUser = function(data = {}) {
    return request({
        options: {
            timeout: 60000,
        },
        url: "/admin/auth/user/synchroUser",
        method: "post",
        data,
    });
};

//-------------------用户管理 end-------------------

//-------------------系统日志-------------------
//列表
api.authSysLogIndex = function(data = {}) {
    return request({
        url: "/admin/auth/SysLog/index",
        method: "get",
        params: data,
    });
};
//-------------------系统日志 end-------------------

//-------------------公告管理 start-------------------
//公告列表
api.noticeIndex = function(data = {}) {
    return request({
        url: "/admin/notice/index",
        method: "get",
        params: data,
    });
};
//添加公告
api.noticeEdit = function(data = {}) {
    return request({
        url: "/admin/notice/edit",
        method: "post",
        data,
    });
};
//添加公告
api.noticeAdd = function(data = {}) {
    return request({
        url: "/admin/notice/add",
        method: "post",
        data,
    });
};
//删除公告
api.noticeDel = function(data = {}) {
    return request({
        url: "/admin/notice/del",
        method: "post",
        data,
    });
};

//公告标签列表
api.noticeTagIndex = function(data = {}) {
    return request({
        url: "/admin/notice/tag/index",
        method: "get",
        params: data,
    });
};
//公告标签字典
api.noticeTagDict = function(data = {}) {
    return request({
        url: "/admin/notice/tag/dict",
        method: "get",
        params: data,
    });
};
//添加公告标签
api.noticeTagAdd = function(data = {}) {
    return request({
        url: "/admin/notice/tag/add",
        method: "post",
        data,
    });
};
//删除公告
api.noticeTagDel = function(data = {}) {
    return request({
        url: "/admin/notice/tag/del",
        method: "post",
        data,
    });
};
//是否置顶【1：是，0：否】
api.noticeSetTop = function(data = {}) {
    return request({
        url: "/admin/notice/setTop",
        method: "post",
        data,
    });
};

//配置
api.settingEdit = function(data = {}) {
    return request({
        url: "/admin/setting/edit",
        method: "post",
        data,
    });
};

//配置列表
api.settingIndex = function(data = {}) {
    return request({
        url: "/admin/setting/index",
        method: "get",
        params: data,
    });
};

//-------------------公告管理 end-------------------

export default api;